﻿using Senparc.Weixin.MP.AdvancedAPIs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RiderShop.Mobile.Common.Component
{
    public static class TestWeixinMessageTemplateSend
    {
        public static void SendMessageTemplate(string portal, string openId, string templateId, string urlDetail,
                                           string topColor, string signature, string timestamp, string nonce,string data)
        {
            //调用SDK发送模板消息
            var result = Template.SendTemplateMessage("Zz5J2pHvYOHccmZBUOGQrcM6_cV76dixjinENX6zUQee0AEwn9C7h8Tg-YkZrFIq6pPLbOvVv2OQOo5i6872t8-KqZEzvXXZI65wmjrjuUw", openId, templateId, topColor, urlDetail, data);
            if (result.errmsg == "ok" && result.errcode == 0)
            {
                Kevin.Comm.Logger.Tracer.TraceLog("SendTemplateMessage:successfuled", "Send Template Message", "SendTemplateMessage", true);
            }
            else
            {
                Kevin.Comm.Logger.Tracer.TraceLog("SendTemplateMessage:failed cause:" + result.errmsg, "Send Template Message", "SendTemplateMessage", true);
            }
        }
    }
}
